<?php

namespace app\index\controller;

use Firebase\JWT\JWT;
use think\Controller;
use think\Db;
use think\facade\Session;
use think\Request;

class Edit extends Controller
{
    public function index()
    {
        $a = Session::get("user");
        $b=Db::name('user')->where('id',$a['id'])->find();
        return $b;
    }


    public function create()
    {
        return [__CLASS__,__FUNCTION__];
    }


    public function save(Request $request)
    {
        return [__CLASS__,__FUNCTION__];
    }


    public function read($id)
    {
        return [__CLASS__,__FUNCTION__];
    }


    public function edit()
    {
        return [__CLASS__,__FUNCTION__];
    }

    public function update()
    {
        $user = new \app\index\model\Edit();
        try {
            $user->updata();
            return ['status' => true];
        } catch (\Exception $e) {
            return ['status' => false, 'error' => $e->getMessage()];
        }
    }


    public function delete($id)
    {
        return [__CLASS__,__FUNCTION__];
    }
}
